cmake_minimum_required(VERSION 2.8)

project(target_track)

#below copy frome cameragimbal-sample
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread -g -O0")
set(ONBOARDSDK_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/../../../osdk-core")
include_directories(${ONBOARDSDK_SOURCE}/api/inc)
include_directories(${ONBOARDSDK_SOURCE}/utility/inc)
include_directories(${ONBOARDSDK_SOURCE}/hal/inc)
include_directories(${ONBOARDSDK_SOURCE}/protocol/inc)
include_directories(${ONBOARDSDK_SOURCE}/platform/linux/inc)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../common)

include_directories(AprilTags . /opt/local/include)
FILE(GLOB SOURCE_FILES *.hpp *.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/../common/dji_linux_environment.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/../common/dji_linux_helpers.cpp
        "AprilTags/*.h"
        )

#file(GLOB source_files_apriltags "src/*.cc")
#include_directories(AprilTags . /opt/local/include)
#add_library(apriltags ${source_files_apriltags})#produce apriltaglib.a#
#file(GLOB header_files "AprilTags/*.h")

find_package( OpenCV REQUIRED )
include_directories( ${OpenCV_INCLUDE_DIRS})


#add_executable(${PROJECT_NAME} "main.cpp" "PosResolve.h" "PosResolve.cpp" "ManifoldSerial.cpp" "ManifoldSerial.h" "flight_control_sample.cpp" "flight_control_sample.h")
add_executable(${PROJECT_NAME} ${SOURCE_FILES})

target_link_libraries( ${PROJECT_NAME} ${OpenCV_LIBS})
target_link_libraries( ${PROJECT_NAME} -ldcam)
target_link_libraries( ${PROJECT_NAME} -lpthread)
target_link_libraries(${PROJECT_NAME} -ldjiosdk-core)
target_link_libraries(${PROJECT_NAME} -lapriltags)


